# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# pyojo                                           Copyright (c) 2011 nabla.net
# ----------------------------------------------------------------------------
""" Demo: pyojo.js.dijit.Button
"""
from pyojo.all import *
from pyojo.js.lib.demo import new_panel

def GET(request):

    button = form.Button(name = True,
                         label = 'Button', 
                         #ID=True,
                         onClick = js.Function("alert('Button.onClick')"),
                         iconClass="pyojoIconAccept")
    
    

    panel = new_panel("Demo Button", "TABS")
    html = "<p>%s</p>" % raw_str(__doc__)
    html += "<pre>%s</pre>" % raw_str(form.Button.__doc__)
    panel["content"] = html
    #html = "<button id=\"%s\"></button>" % button.ID
    #panel.appendChild(button.ID)
    
    return js.Require(button,
                      panel,
                      panel.domNode.appendChild(button.domNode),
                      "status('Button demo ready.');")
